package di

import (
	"week4/configs"
	"week4/internal/dao"
	"week4/internal/service"
)

func MyService(c *configs.DbConfig) (*service.UserService, error) {
	sqlDB, err := configs.MyDb(c)
	if err != nil {
		return nil, err
	}
	userRepo := dao.NewUserRepositoryImpl(sqlDB)
	serviceService := service.MyService(userRepo)
	return serviceService, nil
}
